Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onnxrt calibration issue #1666

Merged
merged 5 commits into from
Mar 14, 2024
Merged

Fix onnxrt calibration issue #1666

merged 5 commits into from
Mar 14, 2024

Conversation

mengniwang95
Copy link
Contributor

Type of Change

bug fix

Description

Fix onnxrt calibration issue

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed

Signed-off-by: Mengni Wang <[email protected]>
@mengniwang95
Copy link
Contributor Author

Copy link

github-actions bot commented Mar 12, 2024

⛈️ Required checks status: Has failure 🔴

Warning
If you do not have the access to re-run the Probot, please contact XuehaoSun for help. If you push a new commit, all of the workflow will be re-triggered.

Groups summary

🟢 Code Scan Tests workflow
Check ID Status Error details
Code-Scan success
Code-Scan (Bandit Code Scan Bandit) success
Code-Scan (DocStyle Code Scan DocStyle) success
Code-Scan (Pylint Code Scan Pylint) success

These checks are required after the changes to neural_compressor/adaptor/ox_utils/calibration.py.

🟢 Model Tests workflow
Check ID Status Error details
Model-Test success
Model-Test (Generate Report GenerateReport) success
Model-Test (Run MXNet Model resnet50v1) success
Model-Test (Run ONNX Model resnet50-v1-12) success
Model-Test (Run PyTorch Model resnet18) success
Model-Test (Run PyTorch Model resnet18_fx) success
Model-Test (Run TensorFlow Model darknet19) success
Model-Test (Run TensorFlow Model inception_v1) success
Model-Test (Run TensorFlow Model resnet-101) success
Model-Test (Run TensorFlow Model resnet50v1.5) success
Model-Test (Run TensorFlow Model ssd_mobilenet_v1_ckpt) success
Model-Test (Run TensorFlow Model ssd_resnet50_v1) success

These checks are required after the changes to neural_compressor/adaptor/ox_utils/calibration.py.

🔴 Unit Tests basic workflow
Check ID Status Error details
UT-Basic failure
UT-Basic (Coverage Compare CollectDatafiles) no_status
UT-Basic (Unit Test FWKs adaptor Test FWKs adaptor) failure download
UT-Basic (Unit Test FWKs adaptor baseline Test FWKs adaptor baseline) failure download
UT-Basic (Unit Test ITEX Test ITEX) success
UT-Basic (Unit Test ITEX baseline Test ITEX baseline) success
UT-Basic (Unit Test Pruning Test PyTorch Pruning) success
UT-Basic (Unit Test Pruning Test TensorFlow Pruning) success
UT-Basic (Unit Test Pruning baseline Test PyTorch Pruning baseline) success
UT-Basic (Unit Test Pruning baseline Test TensorFlow Pruning baseline) success
UT-Basic (Unit Test TF newAPI Test TF newAPI) failure download
UT-Basic (Unit Test TF newAPI baseline Test TF newAPI baseline) failure download
UT-Basic (Unit Test User facing API Test User facing API) success
UT-Basic (Unit Test User facing API baseline Test User facing API baseline) success
UT-Basic (Unit Test other basic case Test other basic case) failure download
UT-Basic (Unit Test other cases baseline Test other cases baseline) failure download

These checks are required after the changes to neural_compressor/adaptor/ox_utils/calibration.py.

🔴 Unit Tests basic no coverage workflow
Check ID Status Error details
UT-Basic-No-Coverage failure
UT-Basic-No-Coverage (Unit Test FWKs adaptor Test FWKs adaptor) failure
UT-Basic-No-Coverage (Unit Test Pruning Test PyTorch Pruning) success
UT-Basic-No-Coverage (Unit Test Pruning Test TensorFlow Pruning) success
UT-Basic-No-Coverage (Unit Test User facing API Test User facing API) success
UT-Basic-No-Coverage (Unit Test other basic case Test other basic case) failure

These checks are required after the changes to neural_compressor/adaptor/ox_utils/calibration.py.

🟢 Unit Tests ITREX workflow
Check ID Status Error details
UT-ITREX success

These checks are required after the changes to neural_compressor/adaptor/ox_utils/calibration.py.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 360 minutes every 180 seconds. If you have any other questions, contact chensuyue or XuehaoSun for help.

@@ -440,8 +440,9 @@ def get_weight_tensors_calib_range(self):
),
)
calibrator = CALIBRATOR["minmax"]() # use minmax method to calibrate initializer tensors
calibrator.collect(initializer_tensor)
weight_tensors_calib_range[initializer_tensor_name] = [list(calibrator.calib_range)]
if initializer_tensor.flatten().size > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why the tensor size would be 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initializer of some ops could be empty, for example Resize op:
image

@mengniwang95
Copy link
Contributor Author

@chensuyue UT failed due to other fwks

@chensuyue chensuyue merged commit cd6d244 into master Mar 14, 2024
38 of 49 checks passed
@chensuyue chensuyue deleted the mengni/calib_fix branch March 14, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants